package com.atguig.g_othernew;

import java.util.Arrays;
import java.util.Comparator;

public class Demo {
    public static void main(String[] args) {
        String[] arr = {"hello","Java"};

        //对数组元素进行排序
        Arrays.sort(arr, new Comparator<>() {
            @Override
            public int compare(String o1, String o2) {
                return o1.compareToIgnoreCase(o2);
            }
        });

        System.out.println("Arrays.toString(arr) = " + Arrays.toString(arr));
    }
}
